<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/resource/common/taglib.jspf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>添加</title>
<%@include file="/resource/common/jquery.jspf"%>
<%@include file="/resource/common/commonCss.jspf"%>
<%@include file="/resource/common/bootstrap.jspf"%>
<%@include file="/resource/common/validate.jspf"%>
<script type="text/javascript" src="${ctxStatic }/js/system/asyncDoSubmitForm.js"></script>

</head>
<body>
	<div id="body-wrapper">
		<div id="main-content">
			<div class="content-box" >
				<div class="content-box-content">
					<div class="tab-content default-tab" id="tab1">
						<fieldset>
							<input type="hidden" id="asyncResult" name="asyncResult" value="0" /> 
							<form:form id="inputForm" name="form1" class="form-horizontal" method="post" action="addWebMessage.do" modelAttribute="WebMessage">
								<div class="row">
									<div class="col-md-6 col-sm-6 col-xs-6" >
										<input type="hidden" id="id" name="id" value="${entity.id}" /> 
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">类型:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<select name="type" id="type" class="form-control input-sm">
													<option value="1" <c:if test="${entity.type==1 }">selected="selected"</c:if>>1</option>
													<option value="2" <c:if test="${entity.type==2 }">selected="selected"</c:if>>2</option>
													<option value="3" <c:if test="${entity.type==3 }">selected="selected"</c:if>>3</option>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">电话:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.phone}" name="phone" id="phone"  placeholder="电话"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">姓名:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.name}" name="name" id="name"  placeholder="姓名"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">邮箱:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.email}" name="email" id="email"  placeholder="邮箱"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">所在地:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.location}" name="location" id="location"  placeholder="留言所在地"/>
											</div>
										</div>
									</div>
									<div class="col-md-6 col-sm-6 col-xs-6" >
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">创建时间:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="<fmt:formatDate value='${entity.createTime}' pattern='yyyy-MM-dd HH:mm:ss' />" name="createTime" id="createTime"  placeholder="创建时间"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">查看时间:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="<fmt:formatDate value='${entity.viewTime}' pattern='yyyy-MM-dd HH:mm:ss' />" name="viewTime" id="viewTime"  placeholder="查看时间"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">修改时间:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="<fmt:formatDate value='${entity.updateTime}' pattern='yyyy-MM-dd HH:mm:ss' />" name="updateTime" id="updateTime"  placeholder="修改时间"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">状态:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<select name="status" id="status" class="form-control input-sm">
													<option value="true" <c:if test="${entity.status==true }">selected="selected"</c:if>>开启</option>
													<option value="false" <c:if test="${entity.status==false }">selected="selected"</c:if>>关闭</option>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">是否已查看:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<select name="isView" id="isView" class="form-control input-sm">
													<option value="true" <c:if test="${entity.isView==true }">selected="selected"</c:if>>是</option>
													<option value="false" <c:if test="${entity.isView==false }">selected="selected"</c:if>>否</option>
												</select>
											</div>
										</div>
									</div>
								</div>
								<div class="row">
									<div class="col-md-12 col-sm-12 col-xs-12" >
										<div class="form-group">
											<label class="col-md-1 col-sm-1 col-xs-1 control-label">留言内容:</label>
											<div class="col-md-11 col-sm-11 col-xs-11">
												<textarea class="form-control input-sm" name="message" id="message">${entity.message}</textarea>
											</div>
										</div>
									</div>
								</div>
							</form:form>
						</fieldset>
					</div>
				</div>
			</div>
		</div>
	</div>
<script type="text/javascript">
var result = 0;
var validateForm;
$(document).ready(function() {
	validateForm = $("#inputForm").validate({
		rules : {
			type : {
				required : true
			},
			phone : {
				required : true
			},
			name : {
				required : true
			},
			email : {
				required : true
			},
			location : {
				required : true
			},
			message : {
				required : true
			},
			status : {
				required : true
			}
		},
		messages : {
			type : {
				required : "留言类型不能为空"
			},
			phone : {
				required : "电话不能为空"
			},
			name : {
				required : "姓名不能为空"
			},
			email : {
				required : "邮箱不能为空"
			},
			location : {
				required : "留言所在地不能为空"
			},
			message : {
				required : "留言内容不能为空"
			},
			status : {
				required : "状态不能为空"
			}
		},
		errorElement : "em",
		errorClass : "validate_error",
		submitHandler: function(form) { //通过之后回调
		},
		invalidHandler: function(form, validator) {
			return false;
		}
	});
});

</script>	
</body>
</html>